describe("get the view html", function() {
    var container = {};

    beforeEach(function() {
        //jqueryAjax = $.ajax
        $.ajax = mocka.mockView()

        container.doIt = function(template, status) {
            expect(template).toEqual("<div id='s1'>{{a}}</div>")
        }

        spyOn(container, "doIt")

        jasmine.clock().install();
    })

    afterEach(function() {
        //$.ajax = jqueryAjax;
        jasmine.clock().uninstall();
        session = {}; //清空掉session
    })


    it("get view function can get the template in 'views' directory ", function() {

        getView("sample_tmp.html", container.doIt);
        jasmine.clock().tick(100)
        expect(container.doIt).toHaveBeenCalled()

    })

    it("getBufferedView function can get the template in views directory", function() {
        getBufferedView("sample_tmp", container.doIt)
        jasmine.clock().tick(100)
        expect(container.doIt).toHaveBeenCalled()
    })

    it("getBufferedView function can put the template in the jc.templates", function() {
        getBufferedView("sample_tmp", function() {
            expect(jc.templates.sample_tmp).toEqual("<div id='s1'>{{a}}</div>")
        })
        jasmine.clock().tick(100)
    })

});